#ifndef FILE_CLASS_H
#define FILE_CLASS_H

#pragma once
#include <QDateTime>
#include <Windows.h>
#include <QSharedPointer>
#include <QEnableSharedFromThis>

QDateTime fileTimeToQDateTime(const FILETIME& fileTime);

class FileInfo
{

private:
    QString name;
    //文件夹类型：Dir
    //文件类型：文件后缀，空则为ThisIsEmp
    QString type;
    QString path;
    qint64 filesize;
    QDateTime creationTime;
    QDateTime lastAccessTime;
    QDateTime lastWriteTime;
    qint64 numOfFile;
    qint64 numOfDir;

public:
    //默认构造
    FileInfo();
    //初始化文件
    FileInfo(QString Name, QString Type, QString Path, qint64 Filesize, QDateTime CTime, QDateTime LATime, QDateTime LWTime);
    //初始化文件夹
    FileInfo(QString Name, QString Type, QString Path, QDateTime CTime, QDateTime LATime, QDateTime LWTime);
    //初始化枚举类型
    FileInfo(QString Type);
    //初始化磁盘
    FileInfo(QString Name, QString Path);

public:
    void SizePlus(qint64 SizeToPlus);
    void DirPlus(qint64 NumToPlus);
    void FilePlus(qint64 NumToPlus);
    void DirPlusPlus();

public:
    QString getName();
    QString getType();
    QString getPath();
    qint64 getSize();
    QDateTime getCreateTime();
    QDateTime getAccessTime();
    QDateTime getWriteTime();
    qint64 getDirNum();
    qint64 getFileNum();

};

#endif // FILE_CLASS_H
